package com.jiashihui.server1.model;

import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * The type Car.
 *
 * @ProjectName:
 * @Package: com.jiashihui.server1.model
 * @ClassName: Car
 * @Description: java类作用描述
 * @Author: jiashihui
 * @CreateDate: 2018 /11/20 10:48
 * @UpdateUser: 更新者
 * @UpdateDate: 2018 /11/20 10:48
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
@Getter
@Setter
public class Car {

    @NotNull(message = "manufacturer不能为空")
    private String manufacturer;

    @NotNull
    @Size(min = 2, max = 14,message = "长度必须介于2和14之间")
    private String licensePlate;

    @Min(value = 2,message = "seatCount的最小值为2")
    private int seatCount;

    /**
     * Instantiates a new Car.
     *
     * @param manufacturer the manufacturer
     * @param licencePlate the licence plate
     * @param seatCount    the seat count
     */
    public Car(String manufacturer, String licencePlate, int seatCount) {
        this.manufacturer = manufacturer;
        this.licensePlate = licencePlate;
        this.seatCount = seatCount;
    }

}
